﻿using System;
using System.Data;
using System.Data.SqlClient;
using Microsoft.Practices.EnterpriseLibrary.Data.Sql;
using Microsoft.Practices.EnterpriseLibrary.Data;
using Csla;

namespace RMSM
{
    [Serializable()]
    public class ThanhToanBOList : Csla.NameValueListBase<int?, string>
    {
        #region Factory Methods
        private ThanhToanBOList()
        {
        }

        private static ThanhToanBOList _list;

        public static ThanhToanBOList GetThanhToanBOList()
        {
            _list = DataPortal.Fetch<ThanhToanBOList>(null);
            return _list;
        }

        public static void InvalidateCache()
        {
            _list = null;
        }
        #endregion Factory Methods
        //==========================================================================

        #region Data Access
        protected override void DataPortal_Fetch(object _spParam)
        {
            RaiseListChangedEvents = false;
            IsReadOnly = false;
            this.Add(new NameValuePair(-1, "Còn công nợ"));
            this.Add(new NameValuePair(0, "Chưa thanh toán"));
            this.Add(new NameValuePair(1, "Đã thanh toán đủ"));
            IsReadOnly = true;
            RaiseListChangedEvents = true;
        }
        #endregion Data Access
        //==========================================================================
    }
}
